/*****************/
function stopBubble(e) {
    // 如果传入了事件对象，那么就是非ie浏览器
    if (e && e.stopPropagation) {
        //因此它支持W3C的stopPropagation()方法
        e.stopPropagation();
    } else {
        //否则我们使用ie的方法来取消事件冒泡
        window.event.cancelBubble = true;
    }
}

var tap = "ontouchstart" in document ? "touchend" : "click";
var winWt = parseInt($(window).width()),
    winHt = parseInt($(window).height());

//实现滚动条无法滚动
var winHadntScroll = function(e) {
    e.preventDefault();
};

/***禁止滑动***/
function scrollStop() {
    var h = $(window).height();
    document.body.style.overflow = "hidden";
    document.addEventListener("touchmove", winHadntScroll, { passive: false }); //禁止页面滑动
}

/***取消滑动限制***/
function scrollMove() {
    document.body.style.overflow = ""; //出现滚动条
    document.removeEventListener("touchmove", winHadntScroll, { passive: false });
}

/// 锚点跳转
function anchorMove(id, fn) {
    var $obj = $(id),
        moveFun = fn;
    var oh = $obj.offset().top - parseInt($(".header").outerHeight());
    $("html,body").animate({
            scrollTop: oh,
        },
        300,
        function() {
            if (moveFun) moveFun();
        }
    );
}

/// 竖向滚动条
if ($(".scrollbox").length > 0) {
    $(".scrollbox").mCustomScrollbar({
        scrollInertia: 1000,
        advanced: {
            updateOnContentResize: true,
        },
    });
}
/// 横向滚动条
if ($(".scrollbox2").length > 0) {
    $(".scrollbox2").mCustomScrollbar({
        axis: "x",
        mouseWheel: true,
        advanced: {
            updateOnContentResize: true,
        },
    });
}

// 页面滚动wow.js再ie9以上引用
var wow = new WOW({
    boxClass: "wow",
    animateClass: "animated",
    offset: 100,
    mobile: true,
    live: true,
});
if (!/msie [6|7|8|9]/i.test(navigator.userAgent)) {
    wow.init();
}

// 模态框
$(".modal").on("shown.bs.modal", function() {
    $("body").addClass("modal-open");
});
$(".modal").on("hidden.bs.modal", function() {
    if ($(this).find("video").length) {
        var videoId = $(this).find(".video-js").attr("id");
        var myplayer = videojs(videoId);
        myplayer.pause();
        myplayer.currentTime(0);
    }
});
$(".modal-close")
    .off(tap)
    .on(tap, function() {
        var $modal = $(this).parents(".modal");
        $modal.modal("hide");
    });

// 判断设备
var os = (function() {
    var ua = navigator.userAgent,
        isWindowsPhone = /(?:Windows Phone)/.test(ua),
        isSymbian = /(?:SymbianOS)/.test(ua) || isWindowsPhone,
        isAndroid = /(?:Android)/.test(ua),
        isIOS = !!ua.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/),
        isFireFox = /(?:Firefox)/.test(ua),
        isChrome = /(?:Chrome|CriOS)/.test(ua),
        isTablet =
        /(?:iPad|PlayBook)/.test(ua) ||
        (isAndroid && !/(?:Mobile)/.test(ua)) ||
        (isFireFox && /(?:Tablet)/.test(ua)),
        isPhone = /(?:iPhone)/.test(ua) && !isTablet,
        isPc = !isPhone && !isAndroid && !isSymbian;
    return {
        isTablet: isTablet,
        isPhone: isPhone,
        isAndroid: isAndroid,
        isIOS: isIOS,
        isPc: isPc,
    };
})();

// 判断是否微信
function is_weixin() {
    var ua = navigator.userAgent.toLowerCase();
    if (ua.match(/MicroMessenger/i) == "micromessenger") {
        return true;
    } else {
        return false;
    }
}

if (!os.isPc) {
    $("body").addClass("is-iphone");
} else {
    $("body").addClass("is-pc");
}
if (os.isAndroid) {
    $("body").addClass("is-android");
}
if (os.isIOS) {
    $("body").addClass("is-ios");
}

if (is_weixin()) {
    $("body").addClass("is-wx");
} else {
    $("body").addClass("not-wx");
}

// 单选框
$(".check-list label").on(tap, function() {
    $(this)
        .parent("li")
        .addClass("is-checked")
        .siblings()
        .removeClass("is-checked");
});

// 视频
$(".btn-open_video").on(tap, function() {
    $(".modal-video").modal("show");
});

$('[data-toggle="tab"]').on(tap, function() {
    var id = $(this).attr("href"),
        $lis = $(this).parent("li");
    $(this).tab("show");
    $lis.addClass("active").siblings().removeClass("active");
});

/******************************/


// PC端导航
$(".head-navlist > li").on("mouseenter", function() {
        $(this)
            .addClass("active")
            .find(".subnav-box")
            .stop(true, true)
            .slideDown(300)
            .end()
            .siblings("li")
            .removeClass("active")
            .find(".subnav-box")
            .hide();
        // $('.header .had-subnav.activeD::after').hide()
        $(".head-navlist .navlv1").removeClass("hab-subnav activeX");
        if ($(this).hasClass("had-subnav")) $(".header").addClass("open-subnav1");
    })
    .on("mouseleave", function() {
        $(this).removeClass("active").find(".subnav-box").hide();
        $(".header").removeClass("open-subnav");
        $(".head-navlist > li.current").addClass("active");
        $(".head-navlist .activeW").addClass("activeX");
        // $(this).find(".activeW").addClass("activeX");
    });

// 鼠标经过页头事件


// 回到顶部
$('.backtop').hide();
$(window).scroll(function() {
    if ($(this).scrollTop() > 100) {
        $('.backtop').fadeIn();
    } else {
        $('.backtop').fadeOut();
    }
});
$('.backtop').on('click', function() {
    $('html,body').animate({
        'scrollTop': '0'
    })
})

// 底部技术支持
if ($('.foot-jszc_swip').length) {
    var footJsSwip = new Swiper('.foot-jszc_swip', {
        direction: 'vertical',
        autoplay: {
            delay: 1000,
            disableOnInteraction: false,
        },
        loop: true,
        observer: true,
        observeParents: true,
    });
}

// $(".header").on("mouseover", function() {
//     $('body').addClass('head-white')
// })
// $(".header").on("mouseleave", function() {
//     $('body').removeClass('head-white')
// })

// 导航
$(window).scroll(function() {
        if ($(window).scrollTop() > 0) {
            $('body').addClass('head-white');
            $(".header").on("mouseleave", function() {
                $('body').addClass('head-white')
            })
        } else if ($(window).scrollTop() < 2) {
            $('body').removeClass('head-white');
            $(".header").on("mouseleave", function() {
                $('body').removeClass('head-white')
            })
        }
    })
    // if ($(window).scrollTop() == 0) {
    //     $('body').removeClass('head-white');
    // }
    // $('.nav-rightbox .searchbox').on('click', function() {
    //     $('.search-box').slideToggle();
    //     $('.bbg1').toggleClass('blackbgShow');
    //     if ($(window).scrollTop() == 0) {
    //         $('.header').toggleClass('head-white1');
    //     }
    // })

var windowWidth = $(window).width()
    // 搜索栏
$('.gg-search').on('click', function(e) {
    $('.search-box').slideToggle(300, 'linear');
    stopBubble(e)
        // e.stopPropagation();
        // e.preventDefault();
        // $('.ph-nav-box').removeClass('on')
        // $('.ph-nav-box').removeClass('on')
        // $('.head-menu_open').removeClass('on')
        // $('.head-menu_open').removeClass('open')
    $('body').toggleClass("head-white1")

    $('.ph-nav-box').removeClass('on')
    $('.ph-nav-box').removeClass('open')
    $('.head-menu_open').removeClass('on')
    $('.head-menu_open').removeClass('open')
    $('body').toggleClass("head-white-s")
    $('body').removeClass("head-white-c")
    $('body').removeClass("open")
        // $('body').css('overflow', 'inherit')
})



// 移动端导航
$(".head-menu_open").on('click', function() {
    $(".language").removeClass("language-open")
        // $('body').toggleClass("head-white1")
    $('body').toggleClass("open")
    $(this).toggleClass("open")

    $(".ph-nav-box").toggleClass("on");

});

$('.headItem').click(function() {
    $(this).find('.headB').stop(true).slideToggle(200)
})
$(".ph-nav-box .lvbox").each(function() {
    $(this).siblings(".lv").find("em").show();
});

$(".lv1 em").on('click', function() {
    $(this).parents(".lv1").toggleClass("on").end()
        .parents(".lv1").siblings(".lv2box").stop(true, true).slideToggle(300).end()
        .parent("li").siblings().find(".lvbox").slideUp(300).siblings(".lv").removeClass("on");
});
$(".lv2 em").on('click', function() {
    $(this).parents(".lv2").toggleClass("on").end()
        .parents(".lv2").siblings(".lv3box").stop(true, true).slideToggle(300).end()
        .parents(".item").siblings().find(".lvbox").removeClass("on").slideUp(300).siblings(".lv").removeClass("on");
});
$(".lv3 em").on('click', function() {
    $(this).parents(".lv3").toggleClass("on").end()
        .parents(".lv3").siblings(".lv4box").stop(true, true).slideToggle(300).end()
        .parents(".item").siblings().find(".lvbox").slideUp(300).siblings(".lv").removeClass("on");
});

// 组织架构
$(".company-pop.mob .boxs .right .box .items .title-box").on('click', function() {
    $(this).parents(".items").toggleClass("on").end()
        // .parents(".items").siblings(".list-box").stop(true, true).slideToggle(300).end()
        .parents(".items").find(".list-box").slideToggle(300).end()
        .parent(".items").siblings().find(".list-box").slideUp(300).removeClass("on");
});

$(".language").on('click', function() {
    $(this).toggleClass("language-open")
})

var windowWidth = $(window).width()

// 判断上下滚动
// if (windowWidth <= 991.98) {
$(document).ready(function() {
        var p = 0,
            t = 0;

        $(window).scroll(function(e) {
            p = $(this).scrollTop();

            if (t <= p) { //向下滚
                // console.log('向下滚');
                $("body").addClass("page-down")
            } else { //向上滚
                // console.log('向上滚');
                $("body").removeClass("page-down")
            }
            setTimeout(function() { t = p; }, 0);
        });
    })
    // }

$(".footer .foot-t1 .link ul a").on('click', function() {
    if ($(this)[0]) {
        console.log('id')
    } else {
        console.log('noid')
    }
})





/*** 公共 ****/


// 公共样式
// 添加wow
$(window).on("load", function() {
    // 银行卡业务
    if ($(".gscet-13").length) {
        $(".gscet-13").addClass("animated fadeInUp2");
        $(".bank5-swiper .image").addClass("wow fadeInUp2");
        $(".bank5-swiper .item-hd").addClass("wow fadeInUp2");
    }
    // 首页
    if ($(".home-sect1").length) {
        $(".home-sect1").addClass("wow fadeInUp2");
    }

    if (wow && !/msie [6|7|8|9]/i.test(navigator.userAgent)) {
        wow.init();
    }
});


// 内页banner轮播
var publicBanner = new Swiper(".public-banner", {
    speed: 500,
    watchOverflow: true,
    slidesPerView: 1,
    disableOnInteraction: false,
    autoplay: {
        delay: 5000,
        stopOnLastSlide: false,
        disableOnInteraction: true,
    },
    observeParents: true,
    observer: true,

    navigation: {
        nextEl: ".public-banner-btn-next",
        prevEl: ".public-banner-btn-prev",
    },
    pagination: {
        el: ".public-banner-btn",
        clickable: true,
    },
});

if (publicBanner.slides.length <= 1) {
    $(".public-banner-btn").hide();
    $(".public-banner-btn-next").hide();
    $(".public-banner-btn-prev").hide();
    $(".public-banner").addClass("swiper-no-swiping");
}


// 新面包屑手机端
if ($(".crumbs-new .box-mob .item-list").length) {
    $('.crumbs-new .box-mob .icon').on(tap, function(e) {
        $('body').toggleClass('mobCrumbs')
        $('.crumbs-new .box-mob .item-list').stop(true).slideToggle()
        e.stopPropagation();
    })

    $(document).on(tap, function() {
        $('.crumbs-new .box-mob .item-list').slideUp()
        $('body').removeClass('mobCrumbs')
    });
}

// 新闻文字
var channel2Swiper = new Swiper(".channel1-swiper2", {
    // loop: true,
    speed: 500,
    watchOverflow: true,
    // effect: 'fade',
    // freeMode: true,

    watchSlidesProgress: true,
    autoplay: {
        delay: 5000,
        stopOnLastSlide: false,
        disableOnInteraction: true,
    },
    breakpoints: {
        0: {
            slidesPerView: 1,
            spaceBetween: 0,
            pagination: {
                el: ".channel1-btn2",
            },
        },
        992: {
            spaceBetween: 40,
            pagination: {
                el: ".channel1-btn2",
                clickable: true,
                type: 'fraction',
            },
        },
    },
    observeParents: true,
    observer: true,

    navigation: {
        nextEl: ".channel1-btn2-next",
        prevEl: ".channel1-btn2-prev",
    },
    thumbs: {
        swiper: channel1Swiper,
    },
    controller: {
        control: channel1Swiper
    }
});

if (channel2Swiper.slides.length <= 1) {
    $(".channel1-btn2").hide();
    $(".channel1-btn2-next").hide();
    $(".channel1-btn2-prev").hide();
    $(".channel1-swiper2").addClass("swiper-no-swiping");
}


// 新闻图片
var channel1Swiper = new Swiper(".channel1-swiper1", {
    // loop: true,
    observer: true,
    observeParents: true,
    // effect: 'fade',
    speed: 500,
    watchOverflow: true,
    spaceBetween: 0,
    autoplay: {
        delay: 5000,
        stopOnLastSlide: false,
        disableOnInteraction: true,
    },
    breakpoints: {
        0: {
            slidesPerView: 1,
        },
        992: {
            pagination: {
                el: ".channel1-btn",
                clickable: true,
                type: 'fraction',
            },
        },
    },
    navigation: {
        nextEl: ".channel1-btn-next",
        prevEl: ".channel1-btn-prev",
    },
});

if (channel1Swiper.slides.length <= 1) {
    $(".channel1-btn").hide();
    $(".channel1-btn-next").hide();
    $(".channel1-btn-prev").hide();
    $(".channel1-swiper1").addClass("swiper-no-swiping");
}


// swiper相互控制
channel1Swiper.controller.control = channel2Swiper
channel2Swiper.controller.control = channel1Swiper

var channel9Swiper = new Swiper(".channel9-swiper", {
    // loop: true,
    observer: true,
    observeParents: true,
    // effect: 'fade',
    speed: 500,
    watchOverflow: true,
    spaceBetween: 0,
    autoplay: {
        delay: 5000,
        stopOnLastSlide: false,
        disableOnInteraction: true,
    },
    breakpoints: {
        0: {
            slidesPerView: 1,
        },
        992: {
            pagination: {
                el: ".channel1-btn",
                clickable: true,
                type: 'fraction',
            },
        },
    },
    navigation: {
        nextEl: ".channel9-btn-next",
        prevEl: ".channel9-btn-prev",
    },
});

if (channel9Swiper.slides.length <= 1) {
    $(".channel9-btn").hide();
    $(".channel9-btn-next").hide();
    $(".channel9-btn-prev").hide();
    $(".channel9-swiper").addClass("swiper-no-swiping");
}

// 人才理念 开始
if (windowWidth >= 991.98) {
    $('.channel11 .right .item').mouseover(function() {
        $(this).addClass('active').siblings().removeClass('active')
        $('.channel11 .left .item').eq($(this).index()).css('display', 'block').animate({
            'opacity': '1',
            'display': 'block'
        }).siblings().css({
            'opacity': '0',
            'display': 'none'
        })
    })
}

if (windowWidth <= 991.98) {
    // $('.channel11 .right .item').mouseover(function() {
    //     $(this).addClass('active').siblings().removeClass('active')
    //     // $('.channel11 .left .item').eq($(this).index()).css('display', 'block').animate({
    //     //     'opacity': '1',
    //     //     'display': 'block'
    //     // }).siblings().css({
    //     //     'opacity': '0',
    //     //     'display': 'none'
    //     // })
    // })
    $('.channel11 .right .item').on('click', function() {
        $(this).find('.doc').slideToggle().addClass('wd');
        $(this).siblings().find('.doc').slideUp();
        $(this).toggleClass('active').siblings().removeClass('active');
    });
}
// 人才理念 结束

// 可持续发展 banner
// $(".p-business .public-banner").addClass("wow fadeInUp2 animated")
// $(".p-business .public-banner").attr("data-wow-delay", '.2s')
// $(".p-business .public-banner .tit-box").addClass("fadeInUp2 animated")
// $(".p-business .public-banner .tit-box").attr("data-wow-delay", '1s')

// 可持续发展
var channel15Swiper2 = new Swiper(".channel15-swiper2", {
    observer: true,
    observeParents: true,
    direction: "vertical",
    slidesPerView: 1,
    spaceBetween: 0,
    mousewheel: true,
    autoHeight: true,
    // autoHeight: true,
    // width: 'auto',
    // height: 'auto',
    height: 80,
    // pagination: {
    //   el: ".swiper-pagination",
    //   clickable: true,
    // },
    speed: 1000,
    on: {
        slideChangeTransitionEnd: function() {
            var $slide = $(this.slides[this.activeIndex]);
            console.log($slide)
            $slide.find('.doc').addClass('upDown wow fadeInUp2 animated')
                .end()
                .siblings().find('.doc').removeClass('upDown wow fadeInUp2 animated');
            // $('.channel15 .left .item').eq($(this).index()).css('display', 'block').animate({
            //     'opacity': '1',
            //     'display': 'block'
            // }).siblings().css({
            //     'opacity': '0',
            //     'display': 'none'
            // })
        },

    },
    thumbs: {
        swiper: channel15Swiper1,
    },
    controller: {
        control: channel15Swiper1
    }
});

// 可持续发展
var channel15Swiper1 = new Swiper(".channel15-swiper1", {
    observer: true,
    observeParents: true,
    direction: "vertical",
    slidesPerView: 1,
    spaceBetween: 50,
    mousewheel: true,
    // autoHeight: true,
    // width: 'auto',
    height: 'auto',
    height: 80,
    // pagination: {
    //   el: ".swiper-pagination",
    //   clickable: true,
    // },
    speed: 1000,
    breakpoints: {
        0: {
            height: 36,
            spaceBetween: 25,
        },
        992: {
            spaceBetween: 20,
        },
        1660: {
            spaceBetween: 50,
        }
    },
    controller: {
        control: channel15Swiper2
    },
    on: {
        slideChangeTransitionStart: function() {
            var $slide = $(this.slides[this.activeIndex]);
            // console.log($slide)

        },
        slideChangeTransitionEnd: function() {
            var $slide = $(this.slides[this.activeIndex]);
            $('.channel15 .left .item').eq(this.activeIndex).addClass('active').siblings().removeClass('active')
                // console.log($slide)
                // $slide.parents(".channel15").find(".left .item").siblings($slide).addClass("qaz").siblings()

            // .removeClass("qaz")
            // $slide.find('.doc').addClass('upDown wow fadeInUp2 animated')
            //     .end()
            //     .siblings().find('.doc').removeClass('upDown wow fadeInUp2 animated');

        },
        // slideChange: function(){
        //     var $slide = $(this.slides[this.activeIndex]);
        //     console.log('改变了，activeIndex为'+this.activeIndex);
        //     $slide.find('.doc').removeClass('upDown wow fadeInUp2 animated');
        //   },
        // slideChangeTransitionEnd: function() {
        //     var $slide = $(this.slides[this.activeIndex]);
        //     console.log($slide)
        //     $slide.find('.doc').addClass('upDown wow fadeInUp2 animated')
        //         .end()
        //         .siblings().find('.doc').removeClass('upDown wow fadeInUp2 animated');
        // },
        // slidePrevTransitionStart: function(){
        //     var $slide = $(this.slides[this.activeIndex]);
        //     console.log('改变了，activeIndex为11'+this.activeIndex);
        //     $slide.find('.doc').removeClass('upDown wow fadeInUp2 animated');
        // },
    }
});

channel15Swiper1.controller.control = channel15Swiper2
channel15Swiper2.controller.control = channel15Swiper1

var businessLength1 = $(".channel17-swiper1.hidden-lg-down .item-box .item").length
var businessLength2 = $(".channel17-swiper2.hidden-lg-down .item-box .item").length
var businessLength3 = $(".channel17-swiper3.hidden-lg-down .item-box .item").length
var businessLength4 = $(".channel17-swiper4.hidden-lg-down .item-box .item").length
var businessLength5 = $(".channel17-swiper5.hidden-lg-down .item-box .item").length
    // console.log(businessLength1, '1')
    // console.log(businessLength2, '2')
    // console.log(businessLength3, '3')
    // console.log(businessLength4, '4')
    // console.log(businessLength5, '5')

if (windowWidth > 991.98) {
    if (businessLength1 <= 6) {
        $(".channel17-swiper1-pagination").hide()
    }
    if (businessLength2 <= 6) {
        $(".channel17-swiper2-pagination").hide()
    }
    if (businessLength3 <= 6) {
        $(".channel17-swiper1-pagination").hide()
    }
    if (businessLength3 <= 6) {
        $(".channel17-swiper1-pagination").hide()
    }
    if (businessLength4 <= 6) {
        $(".channel17-swiper4-pagination").hide()
    }
    if (businessLength5 <= 6) {
        $(".channel17-swiper5-pagination").hide()
    }
    // 业务领域
    // if (businessLength1 >= 6) {
    // $(".channel17-swiper1").addClass("swiper-wrap")
    var channel17Swiper1 = new Swiper(".channel17-swiper1", {
        observer: true,
        observeParents: true,
        slidesPerView: 1,
        // slidesPerGroup: 1,
        spaceBetween: 30,
        // slidesPerColumnFill: "row",
        // height: 'auto',
        // grid: {
        //     fill: 'row',
        //     rows: 2,
        // },
        // spaceBetween: 30,
        // slidesPerColumnFill: 'row',
        // slidesPerColumnFill: "row",
        pagination: {
            el: ".channel17-swiper1-pagination",
            clickable: true,
        },
    });
    // }

    // 业务领域
    // if (businessLength1 < 6) {
    //     $(".channel17-swiper1 .item-box").addClass("swiper-nowrap")
    //     var channel17Swiper1 = new Swiper(".channel17-swiper1", {
    //         slidesPerView: 1,
    //         spaceBetween: 30,
    //         pagination: {
    //             el: ".channel17-swiper1-pagination",
    //             clickable: true,
    //         },
    //     });
    // }

    // 222222
    // if (businessLength2 >= 6) {
    // $(".channel17-swiper2").addClass("swiper-wrap")
    var channel17Swiper2 = new Swiper(".channel17-swiper2", {
        observer: true,
        observeParents: true,
        slidesPerView: 1,
        // slidesPerGroup: 1,
        spaceBetween: 30,
        // slidesPerColumnFill: "row",
        // height: 'auto',
        // grid: {
        //     fill: 'row',
        //     rows: 2,
        // },
        // spaceBetween: 30,
        // slidesPerColumnFill: 'row',
        // slidesPerColumnFill: "row",
        pagination: {
            el: ".channel17-swiper2-pagination",
            clickable: true,
        },
    });
    // }

    // 业务领域
    // if (businessLength2 < 6) {
    //     $(".channel17-swiper2").addClass("swiper-nowrap")
    //     var channel17Swiper2 = new Swiper(".channel17-swiper2", {
    //         slidesPerView: 3,
    //         spaceBetween: 30,
    //         pagination: {
    //             el: ".channel17-swiper2-pagination",
    //             clickable: true,
    //         },
    //     });
    // }


    // 333333
    // if (businessLength3 >= 6) {
    // $(".channel17-swiper3").addClass("swiper-wrap")
    var channel17Swiper3 = new Swiper(".channel17-swiper3", {
        observer: true,
        observeParents: true,
        slidesPerView: 1,
        // slidesPerGroup: 1,
        spaceBetween: 30,
        // slidesPerColumnFill: "row",
        // height: 'auto',
        // grid: {
        //     fill: 'row',
        //     rows: 2,
        // },
        // spaceBetween: 30,
        // slidesPerColumnFill: 'row',
        // slidesPerColumnFill: "row",
        pagination: {
            el: ".channel17-swiper3-pagination",
            clickable: true,
        },
    });
    // }

    // 业务领域
    // if (businessLength3 < 6) {
    //     $(".channel17-swiper3").addClass("swiper-nowrap")
    //     var channel17Swiper3 = new Swiper(".channel17-swiper3", {
    //         slidesPerView: 3,
    //         spaceBetween: 30,
    //         pagination: {
    //             el: ".channel17-swiper3-pagination",
    //             clickable: true,
    //         },
    //     });
    // }

    // 44444
    // if (businessLength4 >= 6) {
    // $(".channel17-swiper4").addClass("swiper-wrap")
    var channel17Swiper4 = new Swiper(".channel17-swiper4", {
        observer: true,
        observeParents: true,
        slidesPerView: 1,
        // slidesPerGroup: 1,
        spaceBetween: 30,
        // slidesPerColumnFill: "row",
        // height: 'auto',
        // grid: {
        //     fill: 'row',
        //     rows: 2,
        // },
        // spaceBetween: 30,
        // slidesPerColumnFill: 'row',
        // slidesPerColumnFill: "row",
        pagination: {
            el: ".channel17-swiper4-pagination",
            clickable: true,
        },
    });
    // }

    // 业务领域
    // if (businessLength4 < 6) {
    //     $(".channel17-swiper4").addClass("swiper-nowrap")
    //     var channel17Swiper4 = new Swiper(".channel17-swiper4", {
    //         slidesPerView: 3,
    //         spaceBetween: 30,
    //         pagination: {
    //             el: ".channel17-swiper4-pagination",
    //             clickable: true,
    //         },
    //     });
    // }

    // 55555
    // if (businessLength5 >= 6) {
    //     $(".channel17-swiper5").addClass("swiper-wrap")
    var channel17Swiper5 = new Swiper(".channel17-swiper5", {
        observer: true,
        observeParents: true,
        slidesPerView: 1,
        // slidesPerGroup: 1,
        spaceBetween: 30,
        // slidesPerColumnFill: "row",
        // height: 'auto',
        // grid: {
        //     fill: 'row',
        //     rows: 2,
        // },
        // spaceBetween: 30,
        // slidesPerColumnFill: 'row',
        // slidesPerColumnFill: "row",
        pagination: {
            el: ".channel17-swiper5-pagination",
            clickable: true,
        },
    });
    // }

    // 业务领域
    // if (businessLength5 < 6) {
    //     $(".channel17-swiper5").addClass("swiper-nowrap")
    //     var channel17Swiper5 = new Swiper(".channel17-swiper5", {
    //         slidesPerView: 3,
    //         spaceBetween: 30,
    //         pagination: {
    //             el: ".channel17-swiper5-pagination",
    //             clickable: true,
    //         },
    //     });
    // }
}

var mobbusinessLength1 = $(".channel17-swiper1.hidden-lg-up .item-box .item").length
var mobbusinessLength2 = $(".channel17-swiper2.hidden-lg-up .item-box .item").length
var mobbusinessLength3 = $(".channel17-swiper3.hidden-lg-up .item-box .item").length
var mobbusinessLength4 = $(".channel17-swiper4.hidden-lg-up .item-box .item").length
var mobbusinessLength5 = $(".channel17-swiper5.hidden-lg-up .item-box .item").length
    // 手机端
if (windowWidth <= 991.98) {
    if (businessLength1 <= 2) {
        $(".channel17-swiper1-pagination").hide()
    }
    if (businessLength2 <= 2) {
        $(".channel17-swiper2-pagination").hide()
    }
    if (businessLength3 <= 2) {
        $(".channel17-swiper1-pagination").hide()
    }
    if (businessLength3 <= 2) {
        $(".channel17-swiper1-pagination").hide()
    }
    if (businessLength4 <= 2) {
        $(".channel17-swiper4-pagination").hide()
    }
    if (businessLength5 <= 2) {
        $(".channel17-swiper5-pagination").hide()
    }
    // $(".channel17-swiper1").addClass("swiper-wrap")
    // $(".channel17-swiper2").addClass("swiper-wrap")
    // $(".channel17-swiper3").addClass("swiper-wrap")
    // $(".channel17-swiper4").addClass("swiper-wrap")
    // $(".channel17-swiper5").addClass("swiper-wrap")
    var channel17Swiper1 = new Swiper(".channel17-swiper1", {
        observer: true,
        observeParents: true,
        slidesPerView: 1,
        // slidesPerGroup: 1,
        spaceBetween: 30,
        // slidesPerColumnFill: "row",
        // height: 'auto',
        // grid: {
        //     fill: 'row',
        //     rows: 2,
        // },
        // spaceBetween: 30,
        // slidesPerColumnFill:'row',
        // slidesPerColumnFill: "row",
        pagination: {
            el: ".channel17-swiper1-pagination",
            clickable: true,
            // type: "progressbar",
        },
    });
    var channel17Swiper2 = new Swiper(".channel17-swiper2", {
        observer: true,
        observeParents: true,
        slidesPerView: 1,
        // slidesPerGroup: 1,
        spaceBetween: 30,
        // slidesPerColumnFill: "row",
        // height: 'auto',
        // grid: {
        //     fill: 'row',
        //     rows: 2,
        // },
        // spaceBetween: 30,
        // slidesPerColumnFill:'row',
        // slidesPerColumnFill: "row",
        pagination: {
            el: ".channel17-swiper2-pagination",
            clickable: true,
            // type: "progressbar",
        },
    });
    var channel17Swiper3 = new Swiper(".channel17-swiper3", {
        observer: true,
        observeParents: true,
        slidesPerView: 1,
        // slidesPerGroup: 1,
        spaceBetween: 30,
        // slidesPerColumnFill: "row",
        // height: 'auto',
        // grid: {
        //     fill: 'row',
        //     rows: 2,
        // },
        // spaceBetween: 30,
        // slidesPerColumnFill:'row',
        // slidesPerColumnFill: "row",
        pagination: {
            el: ".channel17-swiper3-pagination",
            clickable: true,
            // type: "progressbar",
        },
    });
    var channel17Swiper4 = new Swiper(".channel17-swiper4", {
        observer: true,
        observeParents: true,
        slidesPerView: 1,
        // slidesPerGroup: 1,
        spaceBetween: 30,
        // slidesPerColumnFill: "row",
        // height: 'auto',
        // grid: {
        //     fill: 'row',
        //     rows: 2,
        // },
        // spaceBetween: 30,
        // slidesPerColumnFill:'row',
        // slidesPerColumnFill: "row",
        pagination: {
            el: ".channel17-swiper4-pagination",
            clickable: true,
            // type: "progressbar",
        },
    });
    var channel17Swiper5 = new Swiper(".channel17-swiper5", {
        observer: true,
        observeParents: true,
        slidesPerView: 1,
        // slidesPerGroup: 1,
        spaceBetween: 30,
        // slidesPerColumnFill: "row",
        // height: 'auto',
        // grid: {
        //     fill: 'row',
        //     rows: 2,
        // },
        // spaceBetween: 30,
        // slidesPerColumnFill:'row',
        // slidesPerColumnFill: "row",
        pagination: {
            el: ".channel17-swiper5-pagination",
            clickable: true,
            // type: "progressbar",
        },
    });
}

// 关于我们发展历程
var historSwiper = new Swiper(".history-swiper", {
    mousewheel: true,
    breakpoints: {
        0: {
            width: 'auto',
            slidesPerView: 2,
        },
        992: {
            slidesPerView: 4,
        },
    },

    pagination: {
        el: ".history-swiper-pagination",
        type: "progressbar",
    },
    navigation: {
        nextEl: ".history-swiper-button-next",
        prevEl: ".history-swiper-button-prev",
    },
});

// 企业文化
var channel22Swiper = new Swiper(".channel22-swiper", {
    breakpoints: {
        0: {
            loop: true,
            slidesPerView: 1.2,
            height: 36,
            spaceBetween: 20,
            // slidesOffsetBefore: -100,
            centeredSlides: true,
            // centerInsufficientSlides: true,
        },
        992: {
            slidesPerView: 4,
            spaceBetween: 40,
        },
    },
    pagination: {
        el: ".channel22-swiper-pagination",
        clickable: true,
    },
});
// channel22Swiper.slideTo(2, 0, false);
if (channel22Swiper.slides.length <= 4) {
    $(".channel22-swiper-pagination").hide();
    $(".channel22-swiper").addClass("swiper-no-swiping");
}

var channel23Swiper = new Swiper(".channel23-swiper", {
    observer: true,
    observeParents: true,
    // loop: true,
    // height: 'auto',
    // slidesPerColumnFill: "row",
    // grid: {
    //     fill: 'row',
    //     rows: 2,
    // },
    breakpoints: {
        0: {
            slidesPerView: 1,
            // loop: true,
            // height: 36,
            spaceBetween: 30,
            // pagination: {
            //     el: ".channel23-swiper-pagination",
            //     type: "progressbar",
            // },
        },
        992: {
            slidesPerView: 1,
            // slidesPerGroup: 5,

        },

    },
    pagination: {
        el: ".channel23-swiper-pagination",
        clickable: true,
    },
});


var channel23SwiperItem = $(".channel23 .channel23-swiper .item")
    // console.log(channel23SwiperItem)
if (windowWidth > 992) {
    if (channel23SwiperItem <= 10) {
        $(".channel23-swiper-pagination").hide()
    }
} else if (windowWidth < 992) {
    if (channel23SwiperItem <= 6) {
        $(".channel23-swiper-pagination").hide()
    }
}


// 企业公司弹窗
$(".channel19 .more .box").on('click', function() {
    $(".company-pop").show()
    scrollStop()
})
$(".company-close").on('click', function() {
    $(".company-pop").hide()
    scrollMove()
})

// 组织弹框
$(".channel20 .more .box").on('click', function() {
    $(".org-pop").show()
    scrollStop()
})
$(".org-close").on('click', function() {
    $(".org-pop").hide()
    scrollMove()
})

// 联系我们
$(".channel24 .more .box").on('click', function() {
    $(".org-pop").hide()
    $(".contact-pop").show()
    scrollStop()
})
$(".contact-close").on('click', function() {
    $(".contact-pop").hide()
    scrollMove()
})

var channel28Swiper = new Swiper(".channel28-swiper", {
    observer: true,
    observeParents: true,
    breakpoints: {
        0: {
            slidesPerView: 2,
            spaceBetween: 20,
        },
        992: {
            slidesPerView: 4,
            spaceBetween: 27,
        },
    },
    pagination: {
        el: ".channel28-swiper-pagination",
        clickable: true,
    },
});

$('.channel29 .top .item').on('click', function() {
    $(this).addClass('active').siblings().removeClass('active')
    $('.channel29 .channel29-swiper').eq($(this).index()).css('display', 'block').animate({
        'opacity': '1',
        'display': 'block'
    }).siblings().css({
        'opacity': '0',
        'display': 'none'
    })
})

var channel29Swiper1 = new Swiper(".channel29-swiper1", {
    observer: true,
    observeParents: true,
    breakpoints: {
        0: {
            slidesPerView: 2,
            spaceBetween: 30,
        },
        992: {
            slidesPerView: 5,
            spaceBetween: 40,
        },
    },
    pagination: {
        el: ".channel29-swiper1-pagination",
        clickable: true,
    },
});

var channel29Swiper2 = new Swiper(".channel29-swiper2", {
    observer: true,
    observeParents: true,
    breakpoints: {
        0: {
            slidesPerView: 2,
            spaceBetween: 10,
        },
        992: {
            slidesPerView: 5,
            spaceBetween: 40,
        },
    },
    pagination: {
        el: ".channel29-swiper2-pagination",
        clickable: true,
    },
});

var channel29Swiper3 = new Swiper(".channel29-swiper3", {
    observer: true,
    observeParents: true,
    breakpoints: {
        0: {
            slidesPerView: 2,
            spaceBetween: 10,
        },
        992: {
            slidesPerView: 5,
            spaceBetween: 40,
        },
    },
    pagination: {
        el: ".channel29-swiper3-pagination",
        clickable: true,
    },
});